Port of the unix rmpath command